package br.usp.ime.lab.math;

import org.junit.Before;
import org.junit.Test;
import org.junit.Assert;
import br.usp.ime.lab.math.ModuloDeComplexo;

public class ModuloDeComplexoTest  {

	/**
	 * Classe usada para validar a classe ModuloDeComplexo.
	 */
	
	private ModuloDeComplexo moduloDeComplexo;

	@Before
	public void setUp() {
		moduloDeComplexo = new ModuloDeComplexo();
	}

	@Test
	public void testAmbosNulos() {
		Assert.assertEquals(new Double(0), moduloDeComplexo.moduloDeComplexo(null, null));
	}

	@Test
	public void testANulo() {
		Double b = Math.random();
		Assert.assertEquals(b, moduloDeComplexo.moduloDeComplexo(null, b));
	}

	@Test
	public void testModuloComplexo() {
		Double real = new Double(3);
		Double imaginario = new Double(4);
		Assert.assertEquals(new Double(5), moduloDeComplexo.moduloDeComplexo(real, imaginario));
	}
}